﻿// -------------------------------------------------------------------------
//    @FileName         :    NFWorldData.h
//    @Author           :    gaoyi
//    @Date             :    2025-07-09
//    @Email			:    445267987@qq.com
//    @Module           :    NFWorldData
//
// -------------------------------------------------------------------------

#pragma once

#include <NFServerComm/NFServerCommon/NFDBGlobalTemplate.h>
#include "proto_db_world.nanopb.h"
#include "NFLogicCommon/NFLogicShmTypeDefines.h"

class NFWorldData : public NFDBObjectTemplate<NFWorldData, proto_ff::tbWorldData, EOT_WORLD_DATA_ID>
{
public:
    NFWorldData();
    ~NFWorldData() override;
    int CreateInit();
    int ResumeInit();
public:
    void SetId(int id) { m_id = id; }
public:
    int LoadFromDB(const proto_ff::tbWorldData &dbData) override;

    int SaveToDB(proto_ff::tbWorldData &dbData) override;

    int InitConfig() override;

    int GetDbId() override;
public:
    virtual int InitDBData() { return 0; }
protected:
    int m_id;
    pbWorldData m_stData;
};
